﻿using JTC.Genetics.Molecules.Proteins._Abstract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JTC.Genetics.Molecules.Proteins.Filaments
{
    public class Filament<T> : IProteinFilament<T> where T : ProteinBase 
    {
        public Filament()
        {
            _proteins = new List<T>();
        }

        private ICollection<T> _proteins;
        public ICollection<T> Proteins
        {
            get { return _proteins; }
        }

        public void Add(T item)
        {
            _proteins.Add(item);
        }

        public void Clear()
        {
            _proteins.Clear();
        }

        public bool Contains(T item)
        {
            throw new NotImplementedException();
        }

        public void CopyTo(T[] array, int arrayIndex)
        {
            _proteins.CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return _proteins.Count; }
        }

        public bool IsReadOnly
        {
            get { return _proteins.IsReadOnly; }
        }

        public bool Remove(T item)
        {
            return _proteins.Remove(item);
        }

        public IEnumerator<T> GetEnumerator()
        {
           return _proteins.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}
